<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta content="width=device-width,initial-scale=1.0,maximum-scale=1.0,user-scalable=0" name="viewport" />
    <meta content="yes" name="apple-mobile-web-app-capable" />
    <meta content="black" name="apple-mobile-web-app-status-bar-style" />
    <meta content="telephone=no" name="format-detection" />
    <title>小椰货栈</title>
    <script src="js/jquery-3.3.1.min.js"></script>
    <script src="js/ydui.flexible.js"></script>
    <script src="js/vue.js"></script>
    <script src="js/ydui.js"></script>
    <script src="js/nuoxia.js"></script>
    <link rel="stylesheet" href="css/ydui.css">
    <link rel="stylesheet" href="css/public.css">
    <link rel="stylesheet" href="css/nuoxia.css">
</head>

<body>
    <div id="index" class="index">
        <a class="in-search">
            <div class="in-icon">
                <img src="icon/search2.png" alt="">
                <span>搜索</span>
            </div>
            <input type="text">
        </a>
        <div class="in-title">
            <span>微信送好友</span>>
            <span>对方填地址</span>>
            <span>免邮送上门</span>
        </div>
        <div id="masonry" class="container-fluid">
            <div class="box" v-for="(item, index) in list" :key="index">
                <a :href="'class.html?id='+item.id">
                    <img :src="item.image" alt="" srcset="">
                    <p v-text="item.name"></p>
                    <h6 v-text="item.goodsCount"></h6>
                </a>
            </div>
        </div>
    </div>
    <footer class="m-tabbar min-footer tabbar-fixed">
        <a href="index.html" class="tabbar-item">
            <span class="tabbar-icon">
                <img src="icon/tabbar1.png">
            </span>
            <span class="tabbar-txt">首页</span>
        </a>
        <a href="class.html" class="tabbar-item">
            <span class="tabbar-icon">
                <img src="icon/tabbarc2.png">
            </span>
            <span class="tabbar-txt">分类</span>
        </a>
        <a href="service.html" class="tabbar-item">
            <span class="tabbar-icon">
                <img src="icon/tabbarc3.png">
            </span>
            <span class="tabbar-txt">客服</span>
        </a>
        <a href="my.html" class="tabbar-item">
            <span class="tabbar-icon">
                <img src="icon/tabbarc4.png">
            </span>
            <span class="tabbar-txt">我的</span>
        </a>
    </footer>
    <script>
        window.onload = function () {
            var index = new Vue({
                el: "#index",
                data: {
                    list: []
                },
                filters: {

                },
                mounted: function () {
                    this.indexshow();
                    this.wxpubliclogin();
                },
                methods: {
                    indexshow: function () {
                        var v_this = this;
                        $.ajax({
                            type: "get",
                            url: paraurl + "/api/index/index",
                            data: {
                            },
                            success: function (d) {
                                if (d.code == 1) {
                                    var class_arry = d.data.category;
                                    for (var i = 0; i < class_arry.length; i++) {
                                        class_arry[i].image = paraurl + class_arry[i].image;
                                    }
                                    v_this.list = class_arry;
                                }
                            }
                        })
                    },
                    wxpubliclogin:function(){
                        $.ajax({
                            type: "get",
                            url: paraurl + "/api/user/wxpubliclogin",
                            data: {
                            },
                            success: function (d) {
                                if (d.code == 1) {
                                }
                            }
                        })
                    }
                }
            })
        }
    </script>
</body>

</html>